<?php if(!defined('BASEPATH'))exit('No direct script access allowed'); ?>
<?php $this->load->view('admin/global/header'); ?>
<?php $this->load->view('admin/global/left'); ?>
<table cellpadding="0" cellspacing="0">
    <tr>
        <td class="title"><?php echo lang('LIST').': '.lang('CONTACT'); ?></td>
    </tr>
    <?php if(isset($denied)){ ?>
    <tr>
        <td class="bar">
            <div class="error"><?php echo lang('DENIED'); ?></div>
            <meta http-equiv="refresh" content="5; <?php echo base_url().ADMIN_PATH; ?>" />
        </td>
    </tr>
    <?php }else{ ?>
    <?php echo Modules::run('admin/bar_module/index', $buttons, $searchs, $filters); ?>
    <tr>
        <td valign="top">
        <form name="frmView" id="frmView" method="post">
            <table class="view" cellpadding="0" cellspacing="0">
                <tr class="title">
                    <td class="index">#</td>
                    <td width="20">
                        <input type="checkbox" name="checkAll" id="checkAll" value="0" />
                    </td>
                    <?php echo Modules::run('admin/sort_module/index', 'title', lang('TITLE')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'fullname', lang('CONTACTER')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'email', lang('EMAIL')); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'position', lang('POSITION_CONTACT'), 110); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'view', lang('VIEW'), 80); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'reply', lang('REPLY'), 80); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'postDate', lang('CONTACT_DATE'), 110); ?>
                    <?php echo Modules::run('admin/sort_module/index', 'id', lang('ID'), 50); ?>
                </tr>
                <!--LOOP-->
                <?php $index = 1; ?>
                <?php foreach($rows as $row){ ?>
                <tr class="<?php if($index%2 == 0){echo 'bgColor';} ?>">
                    <td class="index"><?php echo $sTT++; ?></td>
                    <td align="center">
                        <input type="checkbox" name="idRecord[]" id="idRecord<?php echo $index; ?>" class="idRecord" value="<?php echo $row->conID; ?>" />
                    </td>
                    <td>
                        <a href="<?php echo base_url().ADMIN_PATH; ?>contact/detail/<?php echo $row->conID; ?>" title="<?php echo lang('VIEW'); ?>">
                            <?php echo $row->conTitle; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $row->conFullname; ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/expand.png" class="vtip" title="<?php echo tip(array(lang('ADDRESS')=>$row->conAddress, lang('TEL')=>$row->conPhone)); ?>" align="absmiddle" />
                    </td>
                    <td>
                        <a href="mailto:<?php echo $row->conEmail; ?>" title="<?php echo $row->conEmail; ?>">
                            <?php echo $row->conEmail; ?>
                        </a>
                    </td>
                    <td align="center">
                        <?php if((int)$row->conPosition == 1){ ?>
                        <span class="blue"><b><?php echo lang('BUSINESS'); ?></b></span>
                        <?php }else{ ?>
                        <span class="green"><b><?php echo lang('TECH'); ?></b></span>
                        <?php } ?>
                    </td>
                    <td align="center">
                        <?php if((int)$row->conView == 1){ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status1.png" title="<?php echo lang('VIEWED'); ?>" style="cursor:default;" />
                        <?php }else{ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status0.png" title="<?php echo lang('UNVIEWED'); ?>" style="cursor:default;" />
                        <?php } ?>
                    </td>
                    <td align="center">
                        <?php if((int)$row->conReply == 1){ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status1.png" title="<?php echo lang('REPLIED'); ?>" style="cursor:default;" />
                        <?php }else{ ?>
                        <img src="<?php echo base_url(); ?>templates/admin/images/status0.png" title="<?php echo lang('UNREPLIED'); ?>" style="cursor:default;" />
                        <?php } ?>
                    </td>
                    <td align="center"><b><?php echo date_convert($row->conPostDate); ?></b></td>
                    <td align="center"><?php echo $row->conID; ?></td>
                </tr>
                <?php $index++; ?>
                <?php } ?>
                <!--LOOP-->
                <?php echo Modules::run('admin/pagination_module/index', $total, 10); ?>
            </table>
            <input type="hidden" name="action" value="" />
            <input type="hidden" name="value" value="" />
        </form>
        </td>
    </tr>
    <?php } ?>
</table>
<?php $this->load->view('admin/global/right'); ?>
<?php $this->load->view('admin/global/footer'); ?>